#from brick.states.splash import BrickSplashState
#from brick.states.menu import BrickMenuState

import os.path
from pkg_resources import resource_listdir

def _init():
    for fn in resource_listdir("brick", "states"):
        print fn
        name, ext = os.path.splitext(fn)
        print globals().keys()
        if name.startswith('_') or ext != '.py':
            continue
        mod = __import__("brick.states", globals(), locals(), fromlist=[name])
        mod = getattr(mod, name)
        print "mod", mod
        if hasattr(mod, '__all__'):
            all =dict([(n, getattr(mod, n)) for n in mod.__all__]) 
            print "all", all
            globals().update(all)
        print globals().keys()

_init()

